#ifndef _UI_MENU_H_
#define _UI_MENU_H_

#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
#include <stdbool.h>
#include <string.h>
#include <stdlib.h>

#define	PAGE_ITEM_NUM_MAX	(4)

#ifndef TRUE
#define TRUE	(1)
#endif

#ifndef FALSE
#define FALSE	(0)
#endif

typedef void (*CB_MENU)(void *pnode, int key); 

typedef struct _menu {
	struct _menu *prev;
	struct _menu *next;
	struct _menu *up;
	struct _menu *down;
	struct _menu *left;
	struct _menu *right;
	void *param;
	int *_default;
	char last_title[50];
	char cur_title[50];
	CB_MENU cb_show;
	CB_MENU cb_exec;
}MENU_PARAS_NODE;

extern MENU_PARAS_NODE *headnode;

void Menu_Handle();
void Home_Page_Show(MENU_PARAS_NODE *param);
MENU_PARAS_NODE *Add_Down_Page(void *param, int *_default, MENU_PARAS_NODE *last_node, char *last_title, char *cur_title, CB_MENU cb_show);	
MENU_PARAS_NODE *Add_Page_Exec(void *param, int *_default, MENU_PARAS_NODE *last_node, char *last_title, char *cur_title, CB_MENU cb_exec);
MENU_PARAS_NODE *Delete_This_Page(MENU_PARAS_NODE *pnode);

#endif

